<%@page contentType="text/html" pageEncoding="UTF-8"%>
<script>function setIframeHeight(winHeight) {$("#mainpage").height(winHeight - 100);}</script>
<div class="page-content">
	<!-- <div class="page-header">
		<h1>
			控制台
			<small>
				<i class="icon-double-angle-right"></i>
				 查看
			</small>
		</h1>
	</div> --><!-- /.page-header -->
	
	<div class="row">
		<div class="col-xs-12">
			<!-- <iframe src="" name="cc" style="border:0px;" width="100%" scrolling="auto">
			<sitemesh:write property="body"/>
			</iframe> -->
			
			<!-- <iframe src="" style="border:0px;height: 80%;" marginheight="0" marginwidth="0" frameborder="0" scrolling="auto" width="100%" height="100%" id="iframepage" name="iframepage" ></iframe>
 -->
<iframe id="mainpage" name="mainpage" src="" frameborder="0" style="width: 100%;"></iframe>

<!--[if !IE]> -->
<script type="text/javascript">
	window.jQuery || document.write("<script src='${ctx}/static/ace/js/jquery.min.js'>"+"<"+"/script>");
</script>
<!-- <![endif]-->
<!--[if IE]>
<script type="text/javascript">
 	window.jQuery || document.write("<script src='${ctx}/static/ace/js/jquery1x.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
<script src="${ctx}/static/js/iframe.js"/>            
<script>
/* var winWidth = 0;
var winHeight = 0;
var ratioWidth = 0;
var ratioHeight = 0;
function currentWindSize() //函数：获取当前窗口尺寸
{
//获取窗口宽度
if (window.innerWidth)
winWidth = window.innerWidth;
else if ((document.body) && (document.body.clientWidth))
winWidth = document.body.clientWidth;
//获取窗口高度
if (window.innerHeight)
winHeight = window.innerHeight;
else if ((document.body) && (document.body.clientHeight))
winHeight = document.body.clientHeight;
//通过深入Document内部对body进行检测，获取窗口大小
if (document.documentElement && document.documentElement.clientHeight && document.documentElement.clientWidth) {
winHeight = document.documentElement.clientHeight;
winWidth = document.documentElement.clientWidth;
}
}
//设置iframe高度
function setIframeHeight(winHeight) {
$("#mainpage").height(winHeight - 100)
}
function resize() {
currentWindSize();
setIframeHeight(winHeight);
}
//获取当前窗口大小
currentWindSize();

window.onresize = resize;
setIframeHeight(winHeight); */


/* function setIframeHeight(ifrm) { 
	var doc = ifrm.contentDocument? ifrm.contentDocument:  
        ifrm.contentWindow.document; 
	
	var h = getDocHeight(doc);
	//alert(h);
	//if (h <= 550) {
	    ifrm.style.visibility = 'hidden'; 
	    ifrm.style.height = "10px"; // reset to minimal height ... 
	    ifrm.style.height = h + "px"; 
	    ifrm.style.visibility = 'visible'; 
	//} else {
		//ifrm.style.height = 530 + "px";
	//}
} 
 
function getDocHeight(doc) { 
    doc = doc || document; 
    var body = doc.body, html = doc.documentElement; 
    var height = Math.max( body.scrollHeight, body.offsetHeight,  
        html.clientHeight, html.scrollHeight, html.offsetHeight ); 
    return height; 
}  */

/*  function setIframeHeight(iframe) {
	if (iframe) {
	var iframeWin = iframe.contentWindow || iframe.contentDocument.parentWindow;
	if (iframeWin.document.body) {
	var height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
	iframe.height = height;
	//alert(iframe.height);
	}
	}
	}; */

	//setIframeHeight(document.getElementById('mainpage'));
	
/* startInit('mainpage', 560);

var browserVersion = window.navigator.userAgent.toUpperCase();
var isOpera = browserVersion.indexOf("OPERA") > -1 ? true : false;
var isFireFox = browserVersion.indexOf("FIREFOX") > -1 ? true : false;
var isChrome = browserVersion.indexOf("CHROME") > -1 ? true : false;
var isSafari = browserVersion.indexOf("SAFARI") > -1 ? true : false;
var isIE = (!!window.ActiveXObject || "ActiveXObject" in window);
var isIE9More = (! -[1, ] == false);
function reinitIframe(iframeId, minHeight) {
    try {
        var iframe = document.getElementById(iframeId);
        var bHeight = 0;
        if (isChrome == false && isSafari == false)
            bHeight = iframe.contentWindow.document.body.scrollHeight;

        var dHeight = 0;
        if (isFireFox == true)
            dHeight = iframe.contentWindow.document.documentElement.offsetHeight + 2;
        else if (isIE == false && isOpera == false)
            dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
        else if (isIE == true && isIE9More) {//ie9+
            var heightDeviation = bHeight - eval("window.IE9MoreRealHeight" + iframeId);
            if (heightDeviation == 0) {
                bHeight += 3;
            } else if (heightDeviation != 3) {
                eval("window.IE9MoreRealHeight" + iframeId + "=" + bHeight);
                bHeight += 3;
            }
        }
        else//ie[6-8]、OPERA
            bHeight += 3;

        var height = Math.max(bHeight, dHeight);
        if (height < minHeight) height = minHeight;
        iframe.style.height = height + "px";
    } catch (ex) { }
}
function startInit(iframeId, minHeight) {
    eval("window.IE9MoreRealHeight" + iframeId + "=0");
    window.setInterval("reinitIframe('" + iframeId + "'," + minHeight + ")", 100);
} */


/* function reinitIframe(){  
	var iframe = document.getElementById("mainpage");  
	try{  
	    var bHeight = iframe.contentWindow.document.body.scrollHeight;  
	    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;  
	    var height = Math.max(bHeight, dHeight);  
	    iframe.height = height;  
	}catch (ex){}  
	}  
	  
	var timer1 = window.setInterval("reinitIframe()", 500); //定时开始  
	  
	function reinitIframeEND(){  
	var iframe = document.getElementById("mainpage");  
	try{  
	    var bHeight = iframe.contentWindow.document.body.scrollHeight;  
	    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;  
	    var height = Math.max(bHeight, dHeight);  
	    iframe.height = height;  
	}catch (ex){}  
	// 停止定时  
	window.clearInterval(timer1);  
	  
	}   */
	//onload="this.height=this.contentWindow.document.body.scrollHeight"
	

/* function iFrameHeight() {

    var ifm= document.getElementById("mainpage");

    var subWeb = document.frames ? document.frames["mainpage"].document :

ifm.contentDocument;

        if(ifm != null && subWeb != null) {

        ifm.height = subWeb.body.scrollHeight;

        }

} */

//高度自适应
/* var iframe = document.getElementById("mainpage");
var iframeHeight = function() {    
    var hash = window.location.hash.slice(1), h;
    if (hash && /height=/.test(hash)) {
        h = hash.replace("height=", "");
        iframe.height = h;
    }
    setTimeout(iframeHeight, 200);
};
iframeHeight();

$("#mainpage").load(function(){  */
	 /* //this.style.height = 'auto';
	 var bHeight = this.contentWindow.document.body.scrollHeight;
     var dHeight = this.contentWindow.document.documentElement.scrollHeight;

     var height = Math.max(bHeight, dHeight);
     //alert(Math.max(600, height) + 50);
     this.style.height = Math.max(600, height) + 50; */
     
     
/* });  */

/* function reinitIframe(){
	var iframe = document.getElementById("mainpage");
	try{
		var bHeight = iframe.contentWindow.document.body.scrollHeight;
		var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
		var height = Math.max(bHeight, dHeight);
		iframe.height =  height;
	}catch (ex){}
} */
//window.setInterval("reinitIframe()", 200);
</script>
		</div>
	</div>							
</div>